//
//  VMDataSource.h
//  DebugDemo
//
//  Created by XFB on 2018/11/16.
//  Copyright © 2018年 ZhouCheng. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN


typedef void(^CellConfigureBeforeBlock)(id cell, id model, NSIndexPath *indexPath);
typedef void(^SelectCellBlock)(NSIndexPath *indexPath);
typedef void(^ReloadDataBlcok)(NSMutableArray *array);

@interface VMDataSource : NSObject <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) NSMutableArray *dataArray;

- (instancetype)initWithIdentifier:(NSString *)identifier
                    configureBlock:(CellConfigureBeforeBlock)beforeBlock
                       selectBlock:(SelectCellBlock)selectBlock
                   reloadDataBlock:(ReloadDataBlcok)reloadDataBlock;

- (void)addDataArray:(NSArray *)objects;

- (instancetype)modelsAtIndexPath:(NSIndexPath *)indexPath;

@end

NS_ASSUME_NONNULL_END
